CC      = g++
CCDEBUG = g++ -g
CFLAGS  = -w -Wall -pedantic-errors
LDFLAGS = -lmingw32 -lSDLmain -lSDL_image -lSDL
SRC:=$(wildcard src/*.cpp)
OBJ:=$(addprefix obj/,$(notdir $(SRC:.cpp=.o)))
        

all: test.exe
 
debug: test_debug.exe

test.exe: $(OBJ)
	$(CC) -o $@ $^ $(LDFLAGS)
	
test_debug.exe: $(OBJ)
	$(CCDEBUG) -o $@ $^ $(LDFLAGS)	

obj/%.o : src/%.cpp
	$(CC) -c $(CFLAGS) $< -o $@

.PHONY: clean cleanest

clean:
	del obj\*.o

cleanest: clean
	del test.exe
	del test_debug.exe